import {BuildConsoleTable} from "../utils/BuildConsoleTable.js";
import {SonarClient} from "../utils/SonarClient.js";

const table = new BuildConsoleTable('普通发布');

table.printHeader();

// 添加数据
table.addRow({
    type: "app",
    name: "hs_crm_money_service",
    buildStatus: "wait",
    deployStatus: "wait",
    runStatus: "normal",
    desc: "",
    time: "2025-08-20 19:51:18"
});

table.addRow({
    type: "support",
    name: "hs_user_service",
    buildStatus: "success",
    deployStatus: "wait",
    runStatus: "error",
    desc: "服务启动失败，已重启3次",
    time: "2025-08-20 18:30:15"
});

// 更新数据
setTimeout(() => {
    table.updateRow({
        name: "hs_user_service",
        runStatus: "normal",
        deployStatus: "normal",
        desc: "服务启动恢复"
    });
}, 3000);



(async () => {
    const client = new SonarClient(true); // verbose = true 打印日志
    await client.login();
    const result = await client.getCoverage("hs-web-api");
    console.log(result);
})();